import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    selectedKeys: '1',//菜单
    userid: 0,
    token: '',
    OpenKeys: 'sub',
    Submenu:'',//子菜单
    data: '',
  },
  mutations: {
    //更新子菜单
    updateSubmenu(state,Submenu){
      state.Submenu=Submenu
    },
    //更新菜单
    updateselectedKeys(state, selectedKeys) {
      state.selectedKeys = selectedKeys
    },
    updataOpenKeys(state, OpenKeys) {
      state.OpenKeys = OpenKeys
    },
    updatedata(state, data) {
      state.data = data
    },
    updateuserid(state, userid) {
      state.userid = userid
    },
    updataaccount(state, account) {
      state.account = account;
    },
    updatatoken(state, token) {
      state.token = token
    }
  },
  actions: {},
  modules: {}
})